<template>
  <div class="public_height100 p20 pub_bgColorFFF">
    <div class="table_content">
      <!-- ====== 表格上方的筛选条件 start ======-->
      <div class="table_filter flex_space_between">
        <div class="flex_start ">
          <div class="table_filter_search">
            <el-input v-model="params.commonSearch" class="pub_input pub_input_search" placeholder="搜索账号/姓名" clearable @keydown.enter.native="handleSearch" @clear="handleSearch">
              <img slot="prefix" src="@/assets/img/orderManagement/search.png" class="pub_imgSize16" />
            </el-input>
          </div>
          <div class="table_filter_search ml12">
            <el-button type="text" class="public_confirm_btn pub_button" @click="handleSearch"> 搜索 </el-button>
          </div>
        </div>
      </div>
      <!-- ====== 表格上方的筛选条件 end ======-->
      <el-table ref="multipleTable" size="mini" :data="tableData" tooltip-effect="dark" border :height="`${536 * $f}px`" class="wp100 mt12" @selection-change="handleSelectionChange">
        <el-table-column label="账户" prop="username" align="center" />
        <el-table-column label="手机号" prop="phoneNumber" align="center" />
        <el-table-column label="创建时间" prop="createTime" align="center" />
        <el-table-column label="状态" align="center" :width="`${120 * $f}`">
          <template slot-scope="{ row }">
            <div class="tc">
              <span v-if="row.isComplete === '2'" class="cRD">未认证</span>
              <span v-else class="cGR">已认证</span>
            </div>
          </template>
        </el-table-column>
        <template slot="empty">
          <PageEmptyData />
        </template>
      </el-table>
      <div ref="pubPageinationRef" class="pub_pageination flex_center mt18">
        <el-pagination background layout="total,prev, pager, next" :total="tableData.length" :page-size="tableData.length"> </el-pagination>
      </div>
    </div>
  </div>
</template>
<script>
import tableFun from '@/mixin/tableFun.js';
export default {
  mixins: [tableFun],
  data() {
    return {
      resetPasDialogVisible: false, //重置密码弹窗
      tipDialogVisible: false, //添加公司弹窗提示
      params: { commonSearch: '' },
      addParams: { username: '', password: '', companyName: '', companyId: '', realName: '', phoneNumber: '' }
    };
  },
  created() {
    this.getDataList();
  },
  methods: {
    //关闭弹窗
    closeDialog() {
      this.addDialogVisible = false;
      this.deleteDialogVisible = false;
      this.tipDialogVisible = false;
      this.resetPasDialogVisible = false;
      this.addParams = Object.assign({}, this.$options.data());
    },
    //获取表格数据
    async getDataList() {
      let { data } = await this.$api.get(this.$url.queryAllAdministrator, this.params);
      this.tableData = data || [];
    },
    //搜索
    handleSearch() {
      this.getDataList();
    }
  }
};
</script>
<style lang="less" scoped>
.table_content {
  height: calc(100% - 49px);
}
</style>
